let rec power x n = match n with 
	0 -> 1
	|_ -> x * power x (n-1);;
	
let rec application list x = match list with
	[] -> 0
	|(a,b)::l -> a*(power x b) + application l x;;
	
let rec add l1 l2 = match l1 with
	[] -> l2
	|(e1,e2)::l -> match l2 with 
		[] -> l1
		|(f1,f2)::m -> if e2 == f2 then ((e1+f1),f2):: add l m
						else (e1,e2)::(f1,f2):: add l m;;

let rec soustract l1 l2 = match l1 with
	[] -> l1
	|(e1,e2)::l -> match l2 with 
		[] -> l1
		|(f1,f2)::m -> if e2 == f2 then ((e1-f1),f2):: soustract l m
						else (e1,e2)::(-f1,f2):: soustract l m;;
(*						
let rec deriv list = match list with
	[] -> []
	|(a,b)::l -> ((b*a),(b-1):: deriv l;;
*)
